*******************************************************************************************
* Replication Material for "How Political Careers affect Prime-Ministerial Performance"   *
* Authors: Florian Grotz, Ferdinand Müller-Rommel, Jan Berz, Corinna Kroeber, Marko Kukec *
* Date: 07. January 2021                                                                  *
* Tested with Stata version 14.2                                                          *
******************************************************************************************* 


*******************************************************************************
* This file contains the main replication code for findings                   *
* Code is organised by Figure and Table                                       *  
*                                                                             *
* To run all parts of this do-file requires the installation of SSC packages! *
* Please make sure that the following packages are installed:                 *
*                                                                             *
* net install vcemway.pkg						      *
* net install vioplot.pkg                                                     *
* net install estout.pkg 						      *
* net install coefplot.pkg						      *
* net install corrtable.pkg           		  			      *
* to replicate Figure appeareances: net install blindschemes.pkg              *
*******************************************************************************


******************
** Load dataset **
use "PMP_complete_expert_level.dta", clear



***********************************************
** Standardisation and labeling of variables **

* Please ensure that the do-file below is in your working directory
* This do-file labels, mean centers and divides continious right-hand side regression variables by 2 Std. Dev.
do var_label_and_sd.do


** Some replications rely on minor additional datasets (this is highlighted). Please re-run var_label_and_sd.do after
** reloading the main dataset: PMP_complete_expert_level.dta


*** End of preamble ***
***********************


*******************************************************************
** Descriptive graphs and analysis in the article and Appendix A ** 
{


***********
* Figure 1 - replicating this figure collapses the dataset and requires re-running the preamble for further replication

* collapse data to mean and SE of the mean per prime-ministerial cabinet

collapse (mean) mean=pmp_overall (semean) semean=pmp_overall, by(country pmc_name)

* identify PM with lowest average performance value

by country (mean), sort: generate count_var=_n

generate mean_lowest=0

replace mean_lowest=1 if count_var==1

drop count_var

* identify PM with highest average performance value

generate mean_neg=-mean

by country (mean_neg), sort: generate count_var=_n

generate mean_highest=0

replace mean_highest=1 if count_var==1

drop count_var mean_neg

* keep only PM with lowest and highest average performance values

drop if mean_lowest==0 & mean_highest==0

* generate 95% CIs

generate ll=mean-1.96*semean

generate ul=mean+1.96*semean

* order country by average performance value of all PMs (order identified via original dataset)

generate country2=1 if country==1

replace country2=2 if country==3

replace country2=3 if country==7

replace country2=4 if country==8

replace country2=5 if country==2

replace country2=6 if country==6

replace country2=7 if country==5

replace country2=8 if country==9

replace country2=9 if country==11

replace country2=10 if country==10

replace country2=11 if country==4

### create dot plot with rspike plot

graph twoway (dot  mean country2 if mean_lowest==1, horizontal) (dot  mean country2 if mean_highest==1, horizontal) (rspike ll ul country2 if mean_lowest==1, horizontal)  (rspike ll ul country2 if mean_highest==1, horizontal), ylabel(1 "Bulgaria (Oresharski|Kostov)" 2 "Czech Republic (Gross|Klaus I)" 3 "Lithuania (Paksas|Brazauskas I)" 4 "Poland (Suchocka|Tusk I)" 5 "Croatia (Oreskovic|Sanader I)" 6 "Latvia (Emsis|Dombrovskis I)" 7 "Hungary (Gyurcsany III|Orban II)" 8 "Romania (Tudose|Nastase I)" 9 "Slovenia (Pahor|Drnovsek I)" 10 "Slovakia (Radicova|Fico II)" 11 "Estonia (Parts|Ansip III)", angle(horizontal) labsize(vsmall)) ytitle(" ") xlabel(0(1)4, labsize(vsmall)) xtitle("average performance value of prime-ministerial cabinets", size(vsmall)) legend( order(1 "PM with lowest average performance value" 2 "PM with highest average performance value") cols(1))


***********
* Figure 2

* Makes four separate plots for each career variable
vioplot pmp_overall, over(pmc_outsider_dummy) ytitle(Overall performance)
graph save Graph "outsider_overallperformance_vioplot.gph", replace

vioplot pmp_overall, over(pmc_minister_dummy) ytitle(Overall performance)
graph save Graph "minister_overallperformance_vioplot.gph", replace 

vioplot pmp_overall, over(pm_experience_leg) ytitle(Overall performance) 
graph save Graph "MP_overallperformance_vioplot.gph", replace 

vioplot pmp_overall, over(pmc_partyhead_pre) ytitle(Overall performance)
graph save Graph "PH_overallperformance_vioplot.gph", replace 

* combines the four violine plots
graph combine "outsider_overallperformance_vioplot.gph" ///
"minister_overallperformance_vioplot.gph" ///
"MP_overallperformance_vioplot.gph" ///
"PH_overallperformance_vioplot.gph"


*************************
* Figure 3 and Table A2 

eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy i.country i.pmc_decade, vce(cluster pmc_name) baselevels

estimates store outsider1_baseline

eststo: reg pmp_overall i.pmc_outsider_dummy i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

estimates store outsider2

* Compile Table A2
esttab using insider_paper.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction(x) drop(*.country *.pmc_decade)

* Draw Figure 3
coefplot (outsider1_baseline, label(Outsider baseline)) (outsider2, label(Outsider main model)) ///
, drop(_cons *.country *.pmc_decade) xline(0) title("Outsider effect on overall performance")



*************************
* Figure 4 and Table A3 

eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy ///
i.pmc_partyhead_pre i.pm_experience_leg i.pm_sex   /// career & demographics
i.country i.pmc_decade, vce(cluster pmc_name) baselevels

estimates store offices_baseline

eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy ///
i.pmc_partyhead_pre i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

estimates store offices2_nonlinear

eststo: reg pmp_overall i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

estimates store offices3_nonlinear

* Compile Table A3
esttab using offices_paper.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction(x) drop(*.country *.pmc_decade)


* Draw Figure 4
coefplot (offices_baseline, label(Offices baseline)) (offices2_nonlinear, label(Offices main model)) ///
(offices3_nonlinear, label(Interaction model)), keep(*.pmc_outsider_dummy *.pmc_minister_dummy *.pmc_partyhead_pre *.pm_experience_leg ) xline(0)  ///
title("Effect of offices (dichotomous measures) on overall performance")



*************************
* Figure 5 and Table A4 
eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd  ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd ///
c.pmc_partyhead_pre_duration_sd c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd ///
i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd  i.pm_sex /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powerscab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
c.cab_idrange_expert_sd i.cab_coalition i.cab_minority pmc_gdpchange_y1 pmc_unemp_y1  i.country i.pmc_decade, vce(cluster pmc_name) baselevels

* compile table A4
esttab using durations_paper.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction(x) drop(*.country *.pmc_decade)

* estimate margins for Figure 5
margins, dydx(pmc_minister_duration_sd) at(c.pmc_minister_duration_sd==(-1.3(1)8))
marginsplot, xlabel(-1.3 "0" -0.3 "0.7" 0.7 "1.4" 1.7 "2.1" 2.7 "2.8" 3.7 "3.5" 4.7 "4.2" 5.7 "4.9" 6.7 "5.6" 7.7 "6.3")
graph save Graph "margins_minister_dur.gph", replace 

margins, dydx(pmc_partyhead_pre_duration_sd) at(c.pmc_partyhead_pre_duration_sd==(-1.3(1)8.6))
marginsplot, xlabel(-1.3 "0" -0.3 "2" 0.7 "4" 1.7 "6" 2.7 "8" 3.7 "10" 4.7 "12" 5.7 "14" 6.7 "16" 7.7 "18")
graph save Graph "margins_partyhead_dur.gph", replace 

margins, dydx(pm_experience_leg_duration_sd) at(c.pm_experience_leg_duration_sd==(-1.6(1)5.8))
marginsplot, xlabel(-1.6 "0" -0.6 "2.7" 0.4 "5.4" 1.4 "8.1" 2.4 "13.5" 3.4 "16.2" 4.4 "18.9"  5.4 "21.6")
graph save Graph "margins_mp_dur.gph", replace 

graph combine "margins_minister_dur.gph" ///
"margins_partyhead_dur.gph" ///
"margins_mp_dur.gph", ycommon rows(3)
graph save Graph "margins_combined_dur", replace 


* estimate predicted values for Figure 5
margins, at(c.pmc_minister_duration_sd==(-1.3(1)8))
marginsplot, xlabel(-1.3 "0" -0.3 "0.7" 0.7 "1.4" 1.7 "2.1" 2.7 "2.8" 3.7 "3.5" 4.7 "4.2" 5.7 "4.9" 6.7 "5.6" 7.7 "6.3")
graph save Graph "predict_minister_dur.gph", replace 

margins, at(c.pmc_partyhead_pre_duration_sd==(-1.3(1)8.6))
marginsplot, xlabel(-1.3 "0" -0.3 "2" 0.7 "4" 1.7 "6" 2.7 "8" 3.7 "10" 4.7 "12" 5.7 "14" 6.7 "16" 7.7 "18")
graph save Graph "predict_partyhead_dur.gph", replace 

margins, at(c.pm_experience_leg_duration_sd==(-1.6(1)5.8))
marginsplot, xlabel(-1.6 "0" -0.6 "2.7" 0.4 "5.4" 1.4 "8.1" 2.4 "13.5" 3.4 "16.2" 4.4 "18.9"  5.4 "21.6")
graph save Graph "predict_mp_dur.gph", replace 

graph combine "predict_minister_dur.gph" ///
"predict_partyhead_dur.gph" ///
"predict_mp_dur.gph", ycommon rows(3)
graph save Graph "predict_combined_dur", replace 

* combine all graphs drawn into Figure 5
graph combine "predict_combined_dur" ///
"margins_combined_dur"



************
* Table 2 

eststo clear

* binary specification of offices 

foreach var in overall conflict_subd policy_subd crisis_subd international_subd parliament_subd party_subd  {


eststo: reg pmp_`var' i.pmc_outsider_dummy /// outsider
i.pmc_minister_dummy i.pmc_partyhead_pre i.pm_experience_leg /// careers
i.pm_sex /// demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd /// PM cabinet powers
c.pm_power_legislative_sd c.pm_power_legislative_sd#c.pm_power_legislative_sd /// PM legislative powers
c.pres_power_ab_sd#c.pres_power_ab_sd /// presidential powers
c.cab_idrange_expert_sd i.cab_coalition i.cab_minority  /// cabinet context
c.pmc_gdpchange_y1_sd c.pmc_unemp_y1_sd /// economy 
i.country i.pmc_decade, vce(cluster pmc_name) baselevels

}

esttab using dummy_sub.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction(x) drop(*.country *.pmc_decade)
eststo clear


* duration specification of offices 

eststo clear

foreach var in overall conflict_subd policy_subd crisis_subd international_subd parliament_subd party_subd  {


eststo: reg pmp_`var' i.pmc_outsider_dummy /// outsider
c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd /// duration of ministerial career
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd /// duration of legislative career
c.pmc_partyhead_pre_duration_sd c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd /// duration of party head career
i.pm_sex /// demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd /// PM cabinet powers
c.pm_power_legislative_sd c.pm_power_legislative_sd#c.pm_power_legislative_sd /// PM legislative powers
c.pres_power_ab_sd#c.pres_power_ab_sd /// presidential powers
c.cab_idrange_expert_sd i.cab_coalition i.cab_minority  /// cabinet context
c.pmc_gdpchange_y1_sd c.pmc_unemp_y1_sd /// economy 
i.country i.pmc_decade, vce(cluster pmc_name) baselevels

}

esttab using duration_sub.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction(x) drop(*.country *.pmc_decade)
eststo clear



************
* Figure A1

graph twoway scatter pmp_overall pmc_minister_duration || lfit pmp_overall pmc_minister_duration ///
|| lowess pmp_overall pmc_minister_duration
graph save Graph "minister_overallperformance_scatter.gph", replace 


graph twoway scatter pmp_overall pm_experience_leg_duration || lfit pmp_overall pm_experience_leg_duration ///
|| lowess pmp_overall pm_experience_leg_duration
graph save Graph "MP_overallperformance_scatter.gph", replace 


graph twoway scatter pmp_overall pmc_partyhead_pre_duration_graph || lfit pmp_overall pmc_partyhead_pre_duration ///
|| lowess pmp_overall pmc_partyhead_pre_duration
graph save Graph "PH_overallperformance_scatter.gph", replace 


graph combine "minister_overallperformance_scatter.gph" ///
"MP_overallperformance_scatter.gph" ///
"PH_overallperformance_scatter.gph"
graph save Graph "scatter_careers_overallperformance.gph", replace


}



** End of main analysis and Appendix A **
*****************************************


** Robustness checks Appendix B **
{

**************
* Table B1 

* replicating this table requires loading two separate datasets!
* if we want to be nice we could combine these two into one dataset?
* but on the other hand this provides a clear identification of our 131 cases?


* calculation for the 131 PM over six months covered by the expert survey 

use "PM_career_data.dta", clear

ci means pmc_partyhead_pre pmc_partyhead_pre_duration pm_experience_leg pm_experience_leg_duration pmc_minister_dummy pmc_minister_duration



* calculation for the 27 PM under six months not covered by the expert survey 
 
use "PM_career_u6.dta", clear

ci means pmc_partyhead_pre pmc_partyhead_pre_duration pm_experience_leg pm_experience_leg_duration pmc_minister_dummy pmc_minister_duration





*************
* Table B2 

* After replicating the previous Table B1 the preamble should be re-run

eststo clear

eststo: reg pmp_overall ///
i.pmc_partyhead_pre i.pmc_partyhead_during i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy ///
i.pmc_partyhead_pre i.pmc_partyhead_during i.pm_experience_leg i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy ///
i.pmc_partyhead_pre i.pmc_partyhead_during i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

esttab using ph_comparison.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x ) drop(*.country *.pmc_decade) 


*************************************************************
* Table B3 - completing this requires loading a separate dataset

use "PM_career_data.dta", clear

tab  pmc_partyhead_pre pmc_partyhead_during


*************
* Table B4 

* replace prior party head dummy with duration prior party leadership, because less collinearity between the two
* than with the dummy -- duration has a stat. significant effect while party head during does not.

eststo clear

eststo: reg pmp_overall ///
i.pmc_partyhead_during c.pmc_partyhead_pre_duration_sd c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy ///
i.pmc_partyhead_during c.pmc_partyhead_pre_duration_sd c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

*compile table B4
esttab using ph_alt_comparison.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x ) drop(*.country *.pmc_decade) 


*************
* Table B5 

eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.prespow1_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels


eststo: reg pmp_overall i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.prespow1_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels


eststo: reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd  i.pm_sex /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.prespow1_sd /// PM & pres powerscab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
c.cab_idrange_expert_sd i.cab_coalition i.cab_minority pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

*compile table B5
esttab using robustness_elgie.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction(x) drop(*.country *.pmc_decade)




*************
* Table B6

eststo clear


* PM exp for insider outsider
eststo: reg pmp_overall i.pmc_outsider_dummy pmc_prior_pm_exp_sd i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

* PM exp for individual offices interactions
eststo: reg pmp_overall i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg pmc_prior_pm_exp_sd i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels


* PM exp for offices duration variables
eststo: reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd pmc_prior_pm_exp_sd  i.pm_sex /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// 
cab_idrange_expert_sd cab_coalition cab_minority pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels


*compile table B6
esttab using robustness_pmexp.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x ) drop(*.country *.pmc_decade)


**************
* Table B7

eststo clear

* Direct effects (+ new party)
eststo: reg pmp_overall i.pmc_outsider_dummy /// outsider
i.pmc_minister_dummy i.pmc_partyhead_pre i.pm_experience_leg /// careers
i.pm_sex /// demographics
i.pm_party_new /// PM party is a new party
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd /// PM cabinet powers
c.pm_power_legislative_sd c.pm_power_legislative_sd#c.pm_power_legislative_sd /// PM legislative powers
c.pres_power_ab_sd#c.pres_power_ab_sd /// presidential powers
c.cab_idrange_expert_sd i.cab_coalition i.cab_minority  /// cabinet context
c.pmc_gdpchange_y1 c.pmc_unemp_y1 /// economy
i.country i.pmc_decade, vce(cluster pmc_name) baselevels

* Direct effects (+ party head*new party)
eststo: reg pmp_overall i.pmc_outsider_dummy /// outsider
i.pmc_minister_dummy i.pm_party_new##i.pmc_partyhead_pre i.pm_experience_leg /// careers
i.pm_sex /// demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd /// PM cabinet powers
c.pm_power_legislative_sd c.pm_power_legislative_sd#c.pm_power_legislative_sd /// PM legislative powers
c.pres_power_ab_sd#c.pres_power_ab_sd /// presidential powers
c.cab_idrange_expert_sd i.cab_coalition i.cab_minority  /// cabinet context
c.pmc_gdpchange_y1 c.pmc_unemp_y1 /// economy in first year of PM term
i.country i.pmc_decade, vce(cluster pmc_name) baselevels


* Three-way interaction (+ new party direct effect)
eststo: reg pmp_overall ///
i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg /// careers
i.pm_sex /// demographics
i.pm_party_new /// PM party is a new party
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd /// PM cabinet powers
c.pm_power_legislative_sd c.pm_power_legislative_sd#c.pm_power_legislative_sd /// PM legislative powers
c.pres_power_ab_sd#c.pres_power_ab_sd /// presidential powers
c.cab_idrange_expert_sd i.cab_coalition i.cab_minority  /// cabinet context
c.pmc_gdpchange_y1 c.pmc_unemp_y1 /// economy in first year of PM term
i.country i.pmc_decade, vce(cluster pmc_name) baselevels

* compile table B7
esttab using dummy_newparty.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction(x) drop(*.country *.pmc_decade)

*************
* Figure B1

graph twoway scatter pmp_overall pmc_partyhead_pre_duration_sd || lowess pmp_overall pmc_partyhead_pre_duration_sd, by(pm_party_new)


************
*Table B8

egen inflation_y1_sd = std(inflation_y1) , std(2)

eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
inflation_y1_sd pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
inflation_y1_sd pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd  i.pm_sex /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powerscab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
c.cab_idrange_expert_sd cab_coalition cab_minority inflation_y1_sd pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

*compile table B8
esttab using robustness_inflation.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x ) drop(*.country *.pmc_decade)



************
*Table B9

eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority i.pmc_post_electoral  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy i.pmc_partyhead_pre i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority i.pmc_post_electoral /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels


eststo: reg pmp_overall i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority i.pmc_post_electoral /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  i.pmc_post_electoral /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels


* compile table B9
esttab using electoral_cylce_dichotomous.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x ) drop(*.country *.pmc_decade) 




************
*Table B10

eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  c.pmc_years_since_election_sd /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd  i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy i.pmc_partyhead_pre i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority c.pmc_years_since_election_sd /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd  i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  c.pmc_years_since_election_sd /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd  i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  c.pmc_years_since_election_sd /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd  i.country i.pmc_decade, vce(cluster pmc_name) baselevels

* compile table B10
esttab using electoral_cylce_continious.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x ) drop(*.country *.pmc_decade) 


************
*Table B11

eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd  i.country, vce(cluster pmc_name) baselevels


eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy ///
i.pmc_partyhead_pre i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country, vce(cluster pmc_name) baselevels


eststo: reg pmp_overall i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country, vce(cluster pmc_name) baselevels


eststo: reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd  i.pm_sex /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powerscab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
cab_idrange_expert_sd cab_coalition cab_minority pmc_gdpchange_y1_sd pmc_unemp_y1_sd  i.country, vce(cluster pmc_name) baselevels

* compile table B11
esttab using rr2_decadefe.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x )


***********
*Figure B2

eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy i.pm_sex   /// career & demographics
pm_power_cabinet_sd pm_power_legislative_sd pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_avg_sd pmc_unemp_avg_sd i.country  i.pmc_decade, vce(cluster pmc_name) baselevels

acprplot pm_power_cabinet_sd, lowess  
graph save Graph "residual_cabinet.gph", replace 

acprplot pm_power_legislative_sd, lowess  
graph save Graph "residual_legislative.gph", replace 

acprplot pres_power_ab_sd, lowess  
graph save Graph "residual_president.gph", replace 

* combine the draw graphs into Fig. B2
graph combine "residual_cabinet.gph"  "residual_legislative.gph" "residual_president.gph"


************
*Table B12

eststo clear

eststo: reg pmp_overall i.pmc_outsider_dummy i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy ///
i.pmc_partyhead_pre i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd  i.pm_sex /// career & demographics
c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
cab_idrange_expert_sd c.pres_power_ab_sd /// PM & pres powerscab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
i.cab_coalition i.cab_minority pmc_gdpchange_y1 pmc_unemp_y1  i.country i.pmc_decade, vce(cluster pmc_name) baselevels

* compile Table B12
esttab using rr2_institutional.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x ) drop(*.country *.pmc_decade)



**************
* Table B13 

eststo clear

* round continous variables for use as dummies
generate pmc_minister_duration_r=round(pmc_minister_duration)
generate pm_experience_leg_duration_r=round(pm_experience_leg_duration)

eststo: reg pmp_overall i.pmc_outsider_dummy i.pmc_partyhead_pre_duration i.pmc_minister_duration_r i.pm_experience_leg_duration_r ///
i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
c.cab_idrange_expert_sd i.cab_coalition i.cab_minority  /// cabinet context
c.pmc_gdpchange_y1_sd c.pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

*results table
esttab using duration_dummy.rtf, ci r2 aic replace nobaselevels label b(3) ci(3)



}


** End of Robustness checks Appendix B **
*****************************************


** Expert survey data analysis Appendix C **
{

** Additional information on the procedures behind the data presented in Appendix C
** can be found in the expert survey data release at: https://dx.doi.org/10.7802/1998 

************
* Table C1 - this collapses the dataset and requires re-running the preamble
	
	
foreach var in pmp_conflict1 pmp_conflict2 pmp_policy1 pmp_policy2 ///
	pmp_crisis1 pmp_crisis2 pmp_international1 pmp_international2 ///
	pmp_parliament1 pmp_parliament2 pmp_party1 pmp_party2 pmp_rating    {
	
	egen `var'_sd = sd(`var'), by(pmc_name)
	
	}

bysort pmcname: gen seq=_n
drop if seq!=1

estpost sum pmp_conflict1_sd pmp_conflict2_sd pmp_policy1_sd pmp_policy2_sd pmp_crisis1_sd ///
pmp_crisis2_sd pmp_international1_sd pmp_international2_sd pmp_parliament1_sd ///
pmp_parliament2_sd pmp_party1_sd pmp_party2_sd pmp_rating_sd

esttab using reliability_sd1.rtf, cells("count mean min max") label rtf replace


************
* Table C2 presents summary statistics from a qualitative coding of open-ended comments of experts conducted 
* in the the expert survey quality procedures. This procedure can not be included for reasons 
* of participant anonymity, for more information on the procedure please consult the documentation of the 
* GESIS dataset release: https://dx.doi.org/10.7802/1998


*************
* Table C3 - for a replication of the expert level ICCs please consult the R code file Table_C3.R
* Confidence intervals bootstrapped in R will slightly differ from those calculated here

* To replicate ICC numbers and Confidence Intervals 
* for the cabinet level you may run the following:

foreach var in pmp_conflict1 pmp_conflict2 pmp_policy1 pmp_policy2 ///
	pmp_crisis1 pmp_crisis2 pmp_international1 pmp_international2 ///
	pmp_parliament1 pmp_parliament2 pmp_party1 pmp_party2 pmp_rating {
 
		mixed `var' || pmc_name: 
		
		estat icc 		
		}

************
* Figure C1

foreach var in pmp_overall pmp_conflict1 pmp_conflict2 pmp_policy1 pmp_policy2 pmp_crisis1 pmp_crisis2 pmp_international1 ///
pmp_international2 pmp_parliament1 {

corr pmc_duration `var' 
local corr : di %5.3g r(rho) 
graph twoway scatter pmc_duration `var', subtitle("Correlation `corr'")  ytitle("") msymbol(smcircle_hollow)

graph save `var'_corr.gph, replace

}


grc1leg pmp_overall_corr.gph pmp_conflict1_corr.gph pmp_conflict2_corr.gph pmp_policy1_corr.gph ///
pmp_policy2_corr.gph pmp_crisis1_corr.gph pmp_crisis2_corr.gph pmp_international1_corr.gph ///
pmp_international2_corr.gph pmp_parliament1_corr.gph

}


** End of Expert survey data analysis Appendix C **
***************************************************


** Robustness checks Appendix D **
{


*************
*Table D1: Item-test, item-retest and average inter-item correlation (delegation)
*

alpha pmp_conflict1 pmp_conflict2 pmp_policy1 pmp_policy2 pmp_crisis1 pmp_crisis2 pmp_international1 pmp_international2, item std


*************
* Table D2: Item-test, item-retest and average inter-item correlation (accountability)
*

alpha  pmp_parliament1  pmp_party1 pmp_party2, item std


*************
* Table D3: Item-test, item-retest and average inter-item correlation (all items)

alpha pmp_conflict1 pmp_conflict2 pmp_policy1 pmp_policy2 pmp_crisis1 pmp_crisis2 pmp_international1 pmp_international2 pmp_parliament1  pmp_party1 pmp_party2, item std


*************
* Figure D1:
corrtable pmc_duration pmp_overall pmp_conflict1 pmp_conflict2 pmp_policy1 pmp_policy2 pmp_crisis1 pmp_crisis2 pmp_international1 ///
pmp_international2 pmp_parliament1 pmp_party1 pmp_party2, half listwise


*************
* Figure D2: Distribution of prime-ministerial performance indicators by country
graph box pmp_conflict1 pmp_conflict2 pmp_policy1 pmp_policy2 pmp_crisis1 pmp_crisis2 pmp_international1 ///
pmp_international2 pmp_parliament1 pmp_party1 pmp_party2, horizontal by(country)


*************
*Table D4: Robustness check based on alternative construction of the prime-ministerial performance variable
eststo clear

* new dependent variable constructed by overall mean, without prior theoretical steps
egen pmp_overall_robust = rowmean(pmp_conflict1 pmp_conflict2 pmp_policy1 pmp_policy2 pmp_crisis1 pmp_crisis2 pmp_international1 ///
pmp_international2 pmp_parliament1 pmp_party1 pmp_party2)


eststo: reg pmp_overall_robust i.pmc_outsider_dummy i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall_robust i.pmc_outsider_dummy i.pmc_minister_dummy ///
i.pmc_partyhead_pre i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall_robust i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, vce(cluster pmc_name) baselevels

eststo: reg pmp_overall_robust i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd  i.pm_sex /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powerscab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
cab_idrange_expert_sd cab_coalition cab_minority pmc_gdpchange_y1_sd pmc_unemp_y1_sd  i.country i.pmc_decade, vce(cluster pmc_name) baselevels

esttab using rr2_alt_dv.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x ) drop(*.country *.pmc_decade)


*************
*Table D5: Robustness check using two-way clustered standard errors (cabinets and PMs)

* please ensure that the vcemway stata package is installed

* identifiers for the two clusters
encode pm_name, gen(pm_SE)
encode pmc_name,  gen(pmc_SE)

eststo: vcemway reg pmp_overall i.pmc_outsider_dummy i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, cluster(pm_SE pmc_SE) baselevels

eststo: vcemway reg pmp_overall i.pmc_outsider_dummy i.pmc_minister_dummy ///
i.pmc_partyhead_pre i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, cluster(pm_SE pmc_SE) baselevels

eststo: vcemway reg pmp_overall i.pmc_minister_dummy##i.pmc_partyhead_pre##i.pm_experience_leg i.pm_sex   /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powers
cab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
pmc_gdpchange_y1_sd pmc_unemp_y1_sd i.country i.pmc_decade, cluster(pm_SE pmc_SE) baselevels

eststo: vcemway reg pmp_overall i.pmc_outsider_dummy c.pmc_minister_duration_sd c.pmc_minister_duration_sd#c.pmc_minister_duration_sd ///
c.pm_experience_leg_duration_sd c.pm_experience_leg_duration_sd#c.pm_experience_leg_duration_sd c.pmc_partyhead_pre_duration_sd ///
c.pmc_partyhead_pre_duration_sd#c.pmc_partyhead_pre_duration_sd  i.pm_sex /// career & demographics
c.pm_power_cabinet_sd c.pm_power_cabinet_sd#c.pm_power_cabinet_sd c.pm_power_legislative_sd /// PM & pres powers
c.pm_power_legislative_sd#c.pm_power_legislative_sd c.pres_power_ab_sd#c.pres_power_ab_sd /// PM & pres powerscab_idrange_expert_sd cab_coalition cab_minority  /// cabinet context
cab_idrange_expert_sd cab_coalition cab_minority pmc_gdpchange_y1_sd pmc_unemp_y1_sd  i.country i.pmc_decade, cluster(pm_SE pmc_SE) baselevels

esttab using rr2_twoway_se.rtf, ci r2 aic replace nobaselevels label b(3) ci(3) interaction( x ) drop(*.country *.pmc_decade)


**** Please note that table D6 and D7 require a separate dataset from the main analyis!

*************
*Table D6: Relationship between PMs’ experience as MP and CM

use "PM_career_data.dta", clear

tab pm_experience_leg pmc_minister_dummy, by(cntry)

*************
*Table D7: Number of PMs with prior ministerial experience and without parliamentary experience

use "PM_career_data.dta", clear

gen minister_no_mp = 0
recode minister_no_mp (0=1) if pmc_minister_dummy==1 & pm_experience_leg==1

tab  cntry minister_no_mp

}






** End of Robustness checks Appendix D **
*****************************************

** Thank you for reading our Article!


**                            **
** End of replication do-file **
********************************
